import 'package:flutter/material.dart';

import '../../app/res/app_color.dart';

/// * 作者: Tao
/// * 日期: 2025/11/6
/// * 时间: 13:55
/// * 描述: 公共标题空间（带箭头，允许点击跳转）
class CommonTitleWidget extends StatelessWidget {
  /// 图片地址
  final String imageUrl;

  /// 标题
  final String title;

  /// 内容
  final String content;

  /// 点击监听
  final VoidCallback? onTap;

  const CommonTitleWidget(
      {Key? key, required this.imageUrl, required this.title, required this.content, this.onTap})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        onTap?.call();
      },
      child: Row(
        children: [
          Image(image: AssetImage(this.imageUrl), height: 40.0),
          SizedBox(width: 8.0),
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(this.title, style: TextStyle(fontSize: 15.0)),
              SizedBox(height: 1.0),
              Text(this.content, style: TextStyle(fontSize: 10.0, color: AppColor.grey500)),
            ],
          ),
          Spacer(),
          Icon(Icons.arrow_forward_ios, color: AppColor.grey500)
        ],
      ),
    );
  }
}
